Scaling an image well is generally challenging. When zooming, fine structures in the image such as lines and edges need to be preserved, and an apparent resolution of the enlarged image must not be degraded when examined closely by a human observer. Satisfying these basic requirements is difficult, especially for a computer graphics image.
A main difficulty in scaling computer graphics images arises because the human observer is sensitive to structures with high contrast as well as an amount of weight or energy in structures of high contrast. Text, for example, contains abrupt edges and line segments, which are combined to form a letter. Similarly, a computer graphics image is likely to contain abrupt edges when a structure is placed on a background of a different colour. Transitions between these regions are often defined by immediate changes in colour and intensity. When such images are enlarged it is very important to preserve the high contrast appearance of the original image.
Linear filtering usually does an adequate job of maintaining the amount of weight or energy in a structure of high contrast but does a poor job at maintaining the structures themselves. Traditionally, resizing an image has often been done using linear techniques. A Finite Impulse Response (FIR) filter of polyphase design is used to compute interpolated pixels in the scaled image. The scaled image can be either larger or smaller than the source image. The process by which the target image is generated from the FIR filter is known as convolution. Unfortunately, the result is not often visually satisfactory, because linear filters cannot reproduce, or preserve, with sufficient accuracy, high contrast structures such as edges tat reside in many images that are generated by a computer. For instance, using a linear filter that is too “sharp ”, that is, it has significant high frequency gain, will result in a target image that is prone to exhibit “ringing”. This type of phenomenon is referred to as Gibbs effect. Gibbs effect manifests itself in a target image as a visual echo or ripple that surrounds the structure in question. Alternately, if the filter is too “soft”, that is, it has more high frequency attenuation the resulting target image will be perceived as blurry. For example, edges are rounded off. Neither a soft nor a sharp linear filter is adequate.
In order to preserve local contrast in the image, scaling using a nearest neighbour algorithm is sometimes used. The nearest neighbour algorithm replicates the value of the pixel nearest in location to the location of the interpolated pixel. The algorithm preserves structures with high contrast, but often results in images that appear blocky when large resize factors are involved. Further, at smaller resize factors, the nearest neighbour algorithm can lead to finer image structures, such as text, to appear as mixed bold and standard fonts depending on the exact position of the target pixel during interpolation. In either case, the result is not visually pleasing.
Therefore, there is a need to provide a scaling algorithm that preserves edges in high contrast images, while reducing the visually displeasing effects of doing so. Thus, it is an object of the present invention to obviate or mitigate at least some of the above-mentioned disadvantages.